<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中国传媒大学设备预约平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="{$projectUrl}/css/admin_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$projectUrl}/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/globalJsFunction.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/calendar.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/WdatePicker.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 3000,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
});
{/literal}
</script>
</head>
<body>
<div class="main">
  <div class="main_resize">
    <div class="main_left">
      {include file=include/headerLogo.html}
      <div class="clr"></div>
      {include file=include/orderLeftMenu.html}
      <div class="clr"></div>
    </div>
    <div class="main_right">
      {include file=include/headerLogin.html}
      <div class="clr" style="background-color:#C63; height:1px;">&nbsp;</div>
      <div>
      {include file=include/adminTopMenu.html}
      </div>
      <div class="clr">
      	{if $menuSelected eq "submit"}
      	<p>
      		<img src="{$projectUrl}/images/add2.jpg" width="30px" height="20px"/>
      		<span style="font-color:#C60; font-size:16px;">选择班级</span>(总个数:{$courses|@count})
      		<select name="select" onchange="location.href=this.options[this.selectedIndex].value;">
      			<option value="order.php?{$params}&menuSelected={$menuSelected}" >请选择预约所属与的课程</option>
      			{foreach from=$courses item=course name=coursesList}
					    <option value="order.php?{$params}&menuSelected={$menuSelected}&courseId={$course.cid}" {if $course.cid eq $currentCourse.id}selected="selected"{/if}>
					    	{$course.name}
					    </option>
					  {/foreach}
					</select>
					{if $currentCourse.id neq ''}
					<span>&nbsp;&nbsp;有效时间：{$currentCourse.begindate}到{$currentCourse.enddate},&nbsp;剩余预约：{$currentCourse.booktime}</span>
					{/if}
      		</p>
      	{/if}
      	 <!--创建预约-->
      	 {if $currentCourse.id neq ""}
                <div id = "create_user_name" style="font-size:14px;">
                <form action="order.php?{$params}&menuSelected={$menuSelected}&courseId={$currentCourse.id}" method="post">
                <input type="hidden" name="action" id="action" value="search"/>
                <input type="hidden" name="courseId" id="courseId" value="{$currentCourse.id}"/>
                    <table bgcolor="#FFFFFF" width="100%" style="font-size:14px">
                    	<tr>
                    		<td>开始时间</td>
                    		<td>结束时间</td>
                    		<td>设备类型</td>
                    		<td>查询</td>
                    	</tr>
                    	<tr>
                    		<td>
                    			<input class="Wdate" type="text" id="begintime" name="begintime" onClick="WdatePicker()" value="{$searchBeginTime}"/>
                    		</td>
                    		<td>
                    			<input class="Wdate" type="text" id="endtime" name="endtime" onClick="WdatePicker()" value="{$searchEndTime}"/>
                    		</td>
                    		<td>
                    			<select id="type" name="type">
                    				<option value="-1"{if $type eq "-1"} selected="selected"{/if}>全部</option>
	                        <option value="0" {if $type eq "0"} selected="selected"{/if}>设备</option>
	                        <option value="1"{if $type eq "1"} selected="selected"{/if}>服装</option>
	                        <option value="2"{if $type eq "2"} selected="selected"{/if}>教室</option>
	                        </select>
                    		</td>
                    		<td><input type="image" src="{$projectUrl}/images/search.jpg" class="button"/></td>
                    	</tr>
                    </table>
                </form>
                </div>
                <!--创建用户结束-->
          {/if}
      </div>

      <!-- 搜索用户并且进行修改 -->
      <div class="clr">
       <!--全部用户的列表-->
       {if $freeDevices neq ""}
                <div>
                	<p>可预约个数:({$freeDevices|@count})</p>
                    <table width="100%" bgcolor="#FFFFFF" style="font-size:14px;">
                    <tr valign="top"  style="background-color:#C60">
                        <td>图片</td>
                        <td>名字</td>
                        <td>编号</td>
                        <td>介绍</td>
                        <td>类别</td>
                        <td>提交预约</td>
                    </tr>
                    {foreach from=$freeDevices item=freeDevice}
                    <tr valign="top"  onmouseout="this.style.backgroundColor=''"onmouseover="this.style.backgroundColor='#AAAAAA'">
                    		<td><a href="{$projectUrl}/showpictures/showpictures.php?did={$freeDevice.did}" target="_blank">
                    			<img src="{$freeDevice.picture}" width="50" height="40" /></a>
                    			</td>
                        <td>{$freeDevice.name}</td>
                        <td>{$freeDevice.barcode}</td>
                        <td><span style="font-size:12px;" title="{$freeDevice.info}">{$freeDevice.info|truncate:40:".."}</span></td>
                        <td>{if $freeDevice.type eq 0}<span style="font-size:12px;color:#66CC66;">设备</span>
                            {elseif $freeDevice.type eq 1}<span style="font-size:12px;color:#C60;">服装</span>
                            {else}<span style="font-size:12px;color:#EE000;">教室</span>
                            {/if}</td>
                        <td><a href="order.php?&menuSelected={$menuSelected}&courseId={$currentCourse.id}&type={$type}&action=submitOrder&id={$user.id}&did={$freeDevice.did}&beginDate={$freeDevice.beginDate}&endDate={$freeDevice.endDate}">提交申请</a></td>
                    </tr>
                    {/foreach}
                    </table>
                </form>
                </div>
          {/if}
                <!--全部用户的列表-->
      </div>
      <!-- 搜索用户并且进行修改 结束-->
      <div class="clr"></div>
      {if $ordersNumber neq ""}
      <div>
                	<p>所有结果:{$ordersNumber}<!--
					        <form id="form1" name="form1" method="post" action="#">
					            <input type="text" class="keywords" id="searhcorder" name="searchorder" maxlength="50" value="输入用户编号" onclick="value=''"/>
					            <input name="b" type="submit" class="button" value="搜索" />
					        </form>-->
					        </span></p>
               
                <input type="hidden" name="action" id="action" value="deleteorder"/>
                    <table width="100%" bgcolor="#FFFFFF" style="font-size:14px;">
                    <tr valign="top"  style="background-color:#C60">
                    		<td>图片</td>
                        <td>设备</td>
                        <td>编号</td>
                        <td>开始时间</td>
                        <td>结束时间</td>
                        <td>课程</td>
                        <td>领取</td>
                        <td>归还</td>
                        <td>申请时间</td>
                        <td>验证时间</td>
                        <td>状态(处理人)</td>
                    </tr>
                    {foreach from=$orders item=order name=orderlist}
                    <tr valign="top"  onmouseout="this.style.backgroundColor=''"onmouseover="this.style.backgroundColor='#AAAAAA'">
                    		<td><a href="{$projectUrl}/showpictures/showpictures.php?did={$order.did}" target="_blank">
                    			<img src="{$order.picture}" width="25" height="20" /></a>
                    			</td>
                    		<td>{$order.dname}</td>
                    		<td>{$order.barcode}</td>
                    		<td>{$order.start_date}</td>
                    		<td>{$order.end_date}</td>
                    		<td>{$order.cname}</td>
                    		<td>{if $order.checkout eq "0"}未领取
                    			{else}{$order.checkoutdate}
                    			{/if}
                    			</td>
                    		<td>
                    			{if $order.checkin eq "0"}未归还
                    			{else}{$order.checkindate}
                    			{/if}
                    			</td>
                    		<td>{$order.createdate}</td>
                    		<td>{$order.checkdate|truncate:15:""}</td>
                        <td>{if $order.pass eq 0}
                        	<img src="{$projectUrl}/images/default.jpg" width="20px" height="20px"/>
                        	<a href="order.php?pageIndex={$pageIndex}&menuSelected={$menuSelected}&action=undoOrder&orderId={$order.id}">撤销</a>
                        	{elseif  $order.pass eq 1}<img src="{$projectUrl}/images/correct.jpg" width="20px" height="20px"/>({$order.passuid})
                        	{elseif  $order.pass eq 2}<img src="{$projectUrl}/images/reject.jpg" width="20px" height="20px"/>({$order.passuid})
                        	{else}未知{/if}</td>
                    </tr>
                    {/foreach}


                   
                     <tr>
                    <td colspan="5" align="center">
                    <!-- 分页 -->
                        <a href="order.php?pageIndex={$leftPageIndex}&menuSelected={$menuSelected}">&lt;</a>

                    {section start=$leftMostPageIndex loop=$pageIndex step=1 name=pagesection}
                    <a href="order.php?pageIndex={$smarty.section.pagesection.index}&menuSelected={$menuSelected}">
                    {$smarty.section.pagesection.index}&nbsp;&nbsp;
                    </a>
                    {/section}
                    <span style="font-size:18px;"><Strong><bold>{$pageIndex}</bold></Strong>&nbsp;</span>
                    {section start=$pageIndex+1 loop=$rightMostPageIndex+1 step=1 name=rightpagesection}
                    <a href="order.php?pageIndex={$smarty.section.rightpagesection.index}&menuSelected={$menuSelected}">
                    {$smarty.section.rightpagesection.index}&nbsp;&nbsp;
                    </a>
                    {/section}

                    <a href="order.php?pageIndex={$rightPageIndex}&menuSelected={$menuSelected}">&gt;</a>
                    <!-- 分页 -->
                    </td>
                    </tr>
                    </table>
                </div>
      
      {/if}
     

    </div>
    
    <!-- 展示用户的课程列表 -->
    <div class="clr">
    	
    </div>
  </div>
  <div class="footer">
    {include file=include/footer.html}
  </div>
</div>
<div align=center></div></body>
</html>
